using System;
using System.Collections.Generic;
using UnityEngine;
using FairyGUI;

namespace Wwo
{
    public class SysMenuView : Window
    {
        public SysMenuView()
        {
        }

        protected override void OnInit()
        {
            this.contentPane = UIPackage.CreateObject("WaterWorld", "SysMenu").asCom;

            float y = GRoot.inst.height - this.contentPane.height - UISets.GetInstance().m_MainMenuView.height;
            this.SetXY(0, y);

            GComponent btnLoad = this.contentPane.GetChild("btnLoad").asCom;
            btnLoad.onClick.Add(() =>
            {
                UISets.GetInstance().OnlyShow(UISets.GetInstance().m_BackWndView,
                UISets.GetInstance().m_LoadWorldView);
            });

            GComponent btnRtnLogin = this.contentPane.GetChild("btnRtnLogin").asCom;
            btnRtnLogin.onClick.Add(() =>
            {
                // Application.UnloadLevel("SampleScene");
                UISets.GetInstance().OnlyShow(UISets.GetInstance().m_BackWndView,
                UISets.GetInstance().m_GameLoginView);
            });

            GComponent btnExit = this.contentPane.GetChild("btnExit").asCom;
            btnExit.onClick.Add(() =>
            {
                Application.Quit();
            });
        }

        override protected void OnShown()
        {
        }
    }
}